import request from "@/utils/request";

// 查询许可证列表
export function listLicenses(query) {
  return request({
    url: "/admin/assets/licenses/",
    method: "get",
    params: query
  });
}

// 查询许可证详细
export function getLicenses(id) {
  return request({
    url: "/admin/assets/licenses/" + id + "/",
    method: "get"
  });
}

// 新增许可证
export function addLicenses(data) {
  return request({
    url: "/admin/assets/licenses/",
    method: "post",
    data: data
  });
}

// 修改许可证
export function updateLicenses(data) {
  return request({
    url: "/admin/assets/licenses/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除许可证
export function delLicenses(id) {
  return request({
    url: "/admin/assets/licenses/" + id + "/",
    method: "delete"
  });
}

// 导出许可证
export function exportLicenses(query) {
  return request({
    url: "/admin/assets/licenses/export/",
    method: "get",
    params: query
  });
}

export function importsLicenses(data) {
  return request({
    url: "/admin/assets/licenses/import/",
    method: "post",
    data: data
  });
}

// 借出
export function licenseCheckout(data) {
  return request({
    url: "/admin/assets/licensecheckout/",
    method: "post",
    data: data
  });
}

// 归还
export function licenseCheckin(data) {
  return request({
    url: "/admin/assets/licensecheckin/",
    method: "post",
    data: data
  });
}

// 查询许可证的借还记录
export function listLicenserecords(query) {
  return request({
    url: "/admin/assets/licenserecords/",
    method: "get",
    params: query
  });
}
